﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MenuRegistration.aspx.cs" Inherits="MenuRegistration._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Cadastramento de Menu - Sinacor+ / Ambiente ACEITE</title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
        }
        .style4
        {
        }
        .style5
        {
            font-size: 14pt;
        }
        .style7
        {
            width: 112px;
        }
        .style8
        {
            
        }
        .style9
        {
            width: 192px;
        }
    </style>
    <script type="text/javascript">
        function Validacao()
        {

            var TxtAssembly = document.form1.TxtAssembly;
            var TxtClasse = document.form1.TxtClasse;
            var TxtDescricao = document.form1.TxtDescricao;
            var cboModulo = document.form1.cboModulo;
            var cboMenuSuperior = document.form1.cboMenuSuperior;
            var cboFuncao = document.form1.cboFuncao; 
            var cboStatus = document.form1.cboStatus;
                        
            if(!TxtDescricao.value)
            {
                alert("Digite a Chave de Resource do Menu.")
                TxtDescricao.focus();
                return false;
            }

            /*if(!TxtAssembly.value)
            {
                alert("Digite o Assembly do Menu.")
                TxtAssembly.focus();
                return false;
            }
            
            if(!TxtClasse.value)
            {
                alert("Digite a Classe do Menu.")
                TxtClasse.focus();
                return false;
            }*/
            
            if(cboModulo.selectedIndex == 0)
            {
                alert("Selecione o Módulo do Menu.")
                cboModulo.focus();
                return false;
            }

            if(cboFuncao.selectedIndex == 0)
            {
                alert("Selecione a Função do Menu.")
                cboFuncao.focus();
                return false;
            }
            
            if(cboStatus.selectedIndex == 0)
            {
                alert("Selecione o Status do Menu.")
                cboStatus.focus();
                return false;
            }
            
            return true;
        }
    </script>
</head>
<body topmargin=20>
    <form id="form1" runat="server">

    <table align="right" class="style1" 

    <table align="right" class="style1" 
        style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt">
        <tr>
            <td class="style5" width="50%">
                &nbsp;</td>
            <td class="style5" colspan="6">
                Cadastramento de Menu - <i>Sinacor+</i><h1>Ambiente <font color="red"><b>ACEITE</b></font></h1></td>
            <td class="style5" width="50%">
                &nbsp;</td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td colspan="6"><hr size="1" color="black"/>
                &nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style7">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td class="style8" align="right">
                Status:</td>
            <td class="style2" align="left" colspan="2">
                <asp:DropDownList ID="cboStatus" runat="server" Width="357px" 
                    onselectedindexchanged="cboMenuSuperior_SelectedIndexChanged">
                    <asp:ListItem Value="0">Selecione...</asp:ListItem>
                    <asp:ListItem Value="N">Ativo</asp:ListItem>
                    <asp:ListItem Value="S">Bloqueado</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td align="right">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right">
                &nbsp;</td>
            <td align="right" class="style7">
                Assembly:</td>
            <td class="style4" colspan="2">
                <asp:TextBox ID="TxtAssembly" runat="server" Width="350px"></asp:TextBox>
            </td>
            <td class="style8" align="right">
                Classe:</td>
            <td align="left" class="style2" colspan="2">
                <asp:TextBox ID="TxtClasse" runat="server" Width="350px"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right" nowrap="nowrap">
                &nbsp;</td>
            <td align="right" nowrap="nowrap" class="style7">
                Módulo:</td>
            <td class="style4" colspan="2">
                <asp:DropDownList ID="cboModulo" runat="server" Width="357px" 
                    AutoPostBack="True" 
                    onselectedindexchanged="cboModulo_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:Label runat="server" ID="lblMessage" />
            </td>
            <td class="style8" align="right">
                Função:</td>
            <td align="left" class="style2" nowrap colspan="2">
                <asp:DropDownList ID="cboFuncao" runat="server" Width="357px">
                </asp:DropDownList>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right" nowrap="nowrap">
                &nbsp;</td>
            <td align="right" nowrap="nowrap" class="style7">
                Menu Superior:</td>
            <td class="style4" colspan="2">
                <asp:DropDownList ID="cboMenuSuperior" runat="server" Width="357px" 
                    onselectedindexchanged="cboMenuSuperior_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
            <td class="style8" align="right" nowrap>Chave Resource:</td>
            <td align="left" class="style2" nowrap colspan="2">
                <asp:TextBox ID="TxtPreDescricao" runat="server" Width="180px" Enabled="False"></asp:TextBox>
                <asp:TextBox ID="TxtDescricao" runat="server" Width="160px"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style7">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td class="style8">
                &nbsp;</td>
            <td class="style2" colspan="2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right">
                &nbsp;</td>
            <td align="right" colspan="6">
                <asp:TextBox ID="TxtCodMenu" runat="server" Width="29px" Visible="False"></asp:TextBox>
                <asp:TextBox ID="TxtAcao" runat="server" Width="29px" Visible="False"></asp:TextBox>
                <asp:TextBox ID="TxtBloqueioPesq" runat="server" Width="29px" Visible="False"></asp:TextBox>
                <asp:TextBox ID="TxtDescricaoPesq" runat="server" Width="29px" Visible="False"></asp:TextBox>
                <asp:TextBox ID="TxtAssemblyPesq" runat="server" Width="29px" Visible="False"></asp:TextBox>
                <asp:TextBox ID="TxtClassePesq" runat="server" Width="29px" Visible="False"></asp:TextBox>
                <asp:TextBox ID="TxtMenuSuperiorPesq" runat="server" Width="29px" 
                    Visible="False"></asp:TextBox>
                <asp:TextBox ID="TxtFuncaoPesq" runat="server" Width="29px" Visible="False"></asp:TextBox>
                <asp:TextBox ID="TxtModuloPesq" runat="server" Width="29px" Visible="False"></asp:TextBox>
                &nbsp;<asp:Button ID="BtnPesquisar" runat="server" Text="Pesquisar" 
                    Width="93px" onclick="BtnPesquisar_Click" />
&nbsp;<asp:Button ID="BtnLimpar" runat="server" Text="Limpar" Width="93px" 
                    onclick="BtnLimpar_Click" />
&nbsp;<asp:Button ID="BtnGravar" runat="server" Text="Gravar" Width="93px" 
                    onclick="BtnGravar_Click" />
            </td>
            <td align="right">
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td colspan="6">
                <asp:GridView ID="GrdMenu" runat="server" CellPadding="4" ForeColor="#333333" 
                    GridLines="None" Width="940px" AutoGenerateColumns="False" 
                    DataKeyNames="CD_MENU" onrowdatabound="GrdMenu_RowDataBound" 
                    onrowdeleting="GrdMenu_RowDeleting" onrowediting="GrdMenu_RowEditing" 
                    onrowupdating="GrdMenu_RowUpdating" onrowcreated="GrdMenu_RowCreated">
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Font-Size="X-Small" />
                    <Columns>
                        <asp:BoundField DataField="CD_MENU">
                            <ItemStyle Width="5%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DS_MENU" HeaderText="Chave Resource">
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="IN_BLOQUEIO" HeaderText="Há Bloqueio ?">
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CD_SISTEMA" HeaderText="Módulo">
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CD_FUNCAO" HeaderText="Função">
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DS_ASSEMBLY" HeaderText="Assembly">
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DS_CLASSE" HeaderText="Classe">
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DS_MENUSUP" HeaderText="Menu Sup." Visible="False">
                            <HeaderStyle HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:CommandField ShowDeleteButton="True"/>
                        <asp:CommandField ShowEditButton="True" />
                        <asp:BoundField />
                    </Columns>
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                </asp:GridView>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style7">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td class="style8">
                &nbsp;</td>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>


    </form>
</body>
</html>
